<template>
  <div class="container">
    <el-dialog
      title="盘点明细详情"
      :visible.sync="dialog.dialogVisible"
      @open="getData"
      @close="confirm"
      width="1000px"
      center
    >
      <el-table
        :data="tableData"
        border
        style="width: 100%"
        empty-text="暂无数据"
      >
        <el-table-column
          prop="goods_code"
          label="商品编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="goods_name"
          label="商品名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="bar_code"
          label="商品条码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="real_num"
          label="盘点数量"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="spec"
          label="规格"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="unit"
          label="单位"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="class_code"
          label="分类编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="class_name"
          label="分类名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="original_code"
          label="原商品编码"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="original_name"
          label="原商品名称"
          align="center"
        ></el-table-column>
        <el-table-column
          prop="original_num"
          label="原盘点数量"
          align="center"
        ></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">确 定</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { planDetail } from "@/api/check/superCheck.js";
export default {
  props: {
    dialog: Object
  },
  data() {
    return {
      tableData: []
    };
  },
  created() {},
  methods: {
    //关闭
    confirm() {
      this.dialog.dialogVisible = false;
    },
    // 获取数据
    getData() {
      this.tableData = [];
      this.center = [];
      let data = {
        id: this.dialog.id
      };
      planDetail(data).then(res => {
        if (res.code == 0) {
          this.tableData = res.data.goods;
        }
      });
    }
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
  background-size: cover;
}
</style>
